/*唐书亮219980431*/
    var img = document.querySelector("#photo");
    var prev = document.querySelector("#prev");
    var next = document.querySelector("#next");

    // 通过数组存储所有图片的 URL
    var imgUrls = ["images/p2.png", "images/p3.png", /*其他图片 URL*/];
    var currIndex = 0; // 当前显示的图片的索引
    var currentSlide = 0;
    var slides = document.querySelectorAll( ".scroll img");
    var slideCount = slides.length;
    var slideInterval = setInterval(nextSlide, 3000);
    function nextSlide() {
        slides[currentSlide].classList.remove('active');
        currentSlide = (currentSlide + 1) % slideCount;
        slides[currentSlide].classList.add('active');
    }
    // 初始化显示的图片
    img.src = imgUrls[currIndex];

    // 上一张图片
    prev.onclick = function() {
    if (currIndex > 0) {
    currIndex--;
} else {
    currIndex = imgUrls.length - 1;
}
    img.src = imgUrls[currIndex];
}
    next.onclick = function () {
    if (currIndex < imgUrls.length - 1) {
    currIndex++;
} else {
    currIndex = 0;
}
    img.src = imgUrls[currIndex];
}
